//引入组件
import VueRouter from 'vue-router'
import About from '../components/About'
import Default from '../components/Default'
import AdvSearch from '../views/advSearch/AdvSearch.vue'
import AuthorSearch from '../views/authorSearch/AuthorSearch.vue'
import AuthorResult from '../views/searchResult/AuthorResult.vue'
import SchLib from '../views/user/SchLib.vue'
import Article from '../views/literature/Article.vue'
import login from '../views/user/login.vue'
import register from '../views/user/register.vue'
import ScholarPage from "../views/authorSearch/ScholarPage";
import ScholarPage2 from "../views/authorSearch/ScholarPage2";
import Admin from '../views/user/Admin.vue'
import Admin2 from '../views/user/Admin2.vue'
import SearchRes from '../views/NormalSearch/SearchRes.vue'
import settings from "@/views/user/settings";
import ApplySettle from '../views/user/ApplySettle.vue'
import UserPortal from "../views/user/UserPortal";
import ApplyDetail from '@/views/user/ApplyDetail.vue'
import user from "../store/user";
//创建并暴露一个路由器
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location, onResolve, onReject) {
    if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
    return originalPush.call(this, location).catch(err => err)
}
export default new VueRouter({

	routes:[
		{
			path:'/about',
			component:About
		},
		{
			path:'/',
			component:Default,
			meta: {
				noNav: true,
				searchInHeader: false,
			}

		},
		{
			path: '/searchRes',
			component: SearchRes,
			meta: {
				searchInHeader: false,
			}
		},
		{
			path:'/advSearch',
			component:AdvSearch,
			meta: {
				searchInHeader: false,
			}
		},
		{
			path:'/searchAut',
			component: AuthorSearch,
			meta: {
				searchInHeader: false,
			}
		},
		{
			path: '/authorRes',
			component: AuthorResult,
			meta: {
				searchInHeader: false,
			}
		},
		{
			path: '/schLib',
			component: SchLib,
			meta: {
				searchInHeader: false,
			},
		},
		{
			path: '/article',
			component: Article,
			meta: {
				searchInHeader: false,
			}
		},
		{
			path:'/login',
			component:login,
			meta: {
				noNav: false,
				searchInHeader: false,
			}
		},
		{
			path:'/register',
			component:register,
			meta: {
				noNav: false,
				searchInHeader: false,
			}
		},
		{
			path:'/scholar',
			component: ScholarPage,
			meta: {
				searchInHeader: false,
			}
		},
		{
			path:'/scholar1',
			component: ScholarPage2,
			meta: {
				searchInHeader: false,
			}
		},
		{
			path:'/admin',
			component: Admin,
			meta: {
				searchInHeader: false,
			},
		},
		{
			path:'/applyDetail',
			component: ApplyDetail,
			meta: {
				searchInHeader: false,
			},
		},
		{
			path:'/admin2',
			component: Admin2,
			meta: {
				searchInHeader: false,
			},
		},
		{
			path: '/settings',
			component: settings,
			meta: {
				searchInHeader: false,
			}
		},
		{
			path:'/applysettle',
			component: ApplySettle,
			meta: {
				searchInHeader: false,
			}
		},
		{
			path: '/portal',
			component: UserPortal,
			meta: {
				searchInHeader: false,
			}
		}


	]
})